import Vue from "vue";
import Router from "vue-router";
import newSongs from "../views/newSongs.vue";

Vue.use(Router);
//这里是花式加载
export default new Router({
  mode:"history",
  routes: [
    {
      path: "/newSongs",
      name: "newSongs",
      component: newSongs,
      alias:"/"
    },
    {
      path: '/rank',
      component: () =>
          import(/* webpackChunkName: "rank" */ "../views/rank.vue")
    },
    {
      path: '/rank/info/:rankid',
      component: () =>
          import(/* webpackChunkName: "rankInfo" */ "../views/rankInfo.vue")
    },
    {
        path: "/plist",
        // name: "plist",
        component: () =>
          import(/* webpackChunkName: "plist" */ "../views/plist.vue")
      },
      { 
        path: "/plist/info/:specialid",
        // name: "plist",
        component: () =>
          import(/* webpackChunkName: "plist" */ "../views/plistInfo.vue")
      },
      {
        path: "/singer" ,
        name: "singer",
        component: () =>
          import(/* webpackChunkName: "singer" */ "../views/singer.vue")
      },
      {
        path: "/singer/list/:id",
        name: "singer/list",
        component: () =>
          import(/* webpackChunkName: "singerList" */ "../views/singerList.vue")
      },
      {
        path: "/singer/info/:id",
        name: "singer/info",
        component: () =>
          import(/* webpackChunkName: "singerInfo" */ "../views/singerDetaile.vue")
      },
      {
        path:"/search",
        name:"search",
        component:()=>import(/* webpackChunkName: "search" */ "../views/search.vue")
      }
  ]
   
});

//懒加载
// {
//   path: "/about",
//   name: "about",
//   // route level code-splitting
//   // this generates a separate chunk (about.[hash].js) for this route
//   // which is lazy-loaded when the route is visited.
//   component: () =>
//     import(/* webpackChunkName: "about" */ "./views/About.vue")
// }
